package com.hushao.aimi.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * @description: 支付信息
 * @author: 胡少
 * @create: 2018-06-03 17:02
 **/
@ApiModel("支付信息")
@Data
@Entity
public class AimiPayInfo  {

    @Id
    @GenericGenerator(name = "uuid",strategy = "uuid")
    @GeneratedValue(generator = "uuid")
    @Column(length = 32)
    private String id;

    /**
     * 用户id
     */
    @Column(length = 32,nullable = false)
    private String userId;

    /**
     * 订单号
     */
    @Column(nullable = false)
    private Long orderNo;

    /**
     * 支付平台：1-支付宝；2-微信
     */
    @Column(nullable = false)
    private byte payPlatform;

    /**
     * 支付平台流水号
     */
    @Column(length = 256,nullable = false)
    private String platformNumber;

    /**
     * 支付平台状态
     */
    @Column(length = 32,nullable = false)
    private String platformStatus;

    @CreationTimestamp
    private Timestamp createTime;

    @UpdateTimestamp
    private Timestamp updateTime;

    @Column(length = 512)
    private String comment;

    public AimiPayInfo(String userId, Long orderNo, byte payPlatform, String platformNumber, String platformStatus, Timestamp createTime, Timestamp updateTime, String comment) {
        this.userId = userId;
        this.orderNo = orderNo;
        this.payPlatform = payPlatform;
        this.platformNumber = platformNumber;
        this.platformStatus = platformStatus;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.comment = comment;
    }
}
